<?php
/**
 * Created by PhpStorm.
 * User: raymon
 * Date: 17-8-10
 * Time: 下午1:32
 */
$config = array(
    'error_prefix' => '<div class="alert alert-danger alert-dismissible"><i class="icon fa fa-ban"></i>',
    'error_suffix' => '</div>',
    'name16' => array(
        'field' => 'name',
        'label' => '名',
        'rules' => 'trim|required|max_length[16]'
    ),
    'column' => array(
        array(
            'field' => 'name',
            'label' => '栏目名',
            'rules' => 'trim|required|max_length[8]'
        ),
        array(
            'field' => 'active',
            'label' => '开关',
            'rules' => 'trim|required|in_list[0,1]'
        ),
        array(
            'field' => 'module',
            'label' => '模块',
            'rules' => 'trim|required|greater_than_equal_to[0]|less_than[9999]'
        ),
        array(
            'field' => 'parent',
            'label' => '父级',
            'rules' => 'trim|required|greater_than_equal_to[0]|less_than[9999]'
        ),
        array(
            'field' => 'sequence',
            'label' => '排序',
            'rules' => 'trim|required|greater_than_equal_to[0]|less_than[9999]'
        )
    ),
    'users' => array(
        array(
            'field' => 'name',
            'label' => '用户名',
            'rules' => 'trim|required|max_length[8]'
        ),
        array(
            'field' => 'role',
            'label' => '权限',
            'rules' => 'trim|required|greater_than_equal_to[0]|less_than[9999]'
        )
    ),
    'article' => array(
        array(
            'field' => 'title',
            'label' => '文章标题',
            'rules' => 'trim|required|max_length[16]'
        ),
        array(
            'field' => 'titleColor',
            'label' => '标题颜色',
            'rules' => 'required|regex_match[/#[0-9a-fA-F]{6}/]'
        ),
        array(
            'field' => 'content',
            'label' => '文章内容',
            'rules' => ''
        ),
        array(
            'field' => 'releaseTime',
            'label' => '发布时间',
            'rules' => 'required|regex_match[/\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}/]'
        )
    )
);